package com.riche.contractbackend.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.riche.contractbackend.model.domain.Team;
import com.riche.contractbackend.model.domain.User;
import com.riche.contractbackend.model.dto.TeamQuery;
import com.riche.contractbackend.model.request.TeamJoinRequest;
import com.riche.contractbackend.model.request.TeamQuiteRequest;
import com.riche.contractbackend.model.request.TeamUpdateRequest;
import com.riche.contractbackend.model.vo.TeamUserListVo;
import com.riche.contractbackend.model.vo.TeamUserVO;

import java.util.List;

/**
 * @InterfaceName: TeamService
 * @Description: 队伍服务层
 * @Author: Gaoruiqi
 * @Date: 2025-09-10 19:49
 * @Version: 1.0
 **/
public interface TeamService extends IService<Team> {

    /**
     * 创建队伍
     * @param team
     * @param loginUser
     * @return 创建的队伍id
     */
    long addTeam(Team team, User loginUser);


    /**
     * 获取队伍列表
     *
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    TeamUserListVo listTeams(TeamQuery teamQuery, User loginUser);


    /**
     * 修改队伍信息
     * @param teamUpdateRequest
     * @return
     */
    boolean updateById(TeamUpdateRequest teamUpdateRequest, User loginUser);


    /**
     * 用户加入队伍
     *
     * @param teamJoinRequest
     * @param loginUser
     * @return
     */
    Boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);


    /**
     * 退出队伍
     * @param teamQuiteRequest
     * @param loginUser
     * @return
     */
    Boolean quitTeam(TeamQuiteRequest teamQuiteRequest, User loginUser);

    /**
     * 解散队伍
     *
     * @param teamId
     * @param loginUser
     * @return
     */
    boolean deleteTeam(long teamId, User loginUser);
}
